//
//  YQWeixinViewController.swift
//  yq微信
//
//  Created by yq on 2017/8/24.
//  Copyright © 2017年 yq. All rights reserved.
//

import UIKit

class YQWeixinViewController: UITableViewController,EMClientDelegate{
    override func viewDidLoad() {
        super.viewDidLoad()
        // 添加代理
        EMClient.shared().add(self , delegateQueue: nil )
    }
    
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        self.navigationController?.tabBarController?.tabBar.isHidden = false
    }
}

//MARK: -连接状态监听
extension YQWeixinViewController{
    func connectionStateDidChange(_ aConnectionState: EMConnectionState) {
       
    switch aConnectionState {
        case EMConnectionConnected:
            self.title = "微信"
        case EMConnectionDisconnected:
            self.title = "微信(未连接)"
        default:
            return
        }
    }
}
